package com.jzo2o.customer.controller.operation;


import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditorService;
import com.jzo2o.customer.service.IWorkerCertificationAuditorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tyj
 * @since 2025-02-09
 */
@RestController("workerCertificationAuditorController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "运营端 - 服务人员审核")
public class WorkerCertificationAuditorController {

    @Autowired
    IWorkerCertificationAuditorService workerCertificationAuditorService;

    @GetMapping("/page")
    @ApiOperation("服务人员审核分页查询")
    public PageResult<WorkerCertificationAuditResDTO>  selectPage(WorkerCertificationAuditPageQueryReqDTO reqDTO) {
        return workerCertificationAuditorService.selectPage(reqDTO);
    }

    @PutMapping("/audit/{id}")
    @ApiOperation("服务人员审核认证")
    public void  audit(@PathVariable("id") Long id,@RequestParam("rejectReason") String rejectReason, @RequestParam("certificationStatus") Integer certificationStatus) {
        workerCertificationAuditorService.audit(id,rejectReason,certificationStatus);
    }

}
